<!-- 列表页面 -->
<!-- 头部 -->
<block name="bjui-pageHeader">
    <div class="bjui-pageHeader">
        <form id="pagerForm" data-toggle="ajaxsearch" action="{:U($Think.ACTION_NAME)}" method="post">
            <div class="bjui-searchBar">
                <div class="pull-left">
                    <label>统计时间：</label>
                    <?php foreach($countDateList as $name=>$countDate):;?>
                    <div class="btn btn-blue countDate" name="{$name}" value="{$countDate.start_time}">{$countDate.title}</div>
                    <?php endforeach;?>
                    <input type="hidden" name="countDate" value="<?php echo I('countDate') ? I('countDate') : '';?>">
                    <?php if($countTypeList):?>
                        <br/>
                        <?php foreach($countTypeList as $name=>$countType):?>
                        <input type="radio" name="countType" data-toggle="icheck" data-label="{$countType.title}" id="{$name}" value="{$name}" <?php echo (I('countType') && I('countType')==$name) || (!I('countType') && $defaultCountType==$name) ? 'checked' : '';?>>
                        <?php endforeach;?>
                    <?php endif;?>
                </div>
                <input type="text" data-toggle='datepicker' value="{$start_time}" name="start_time" class="form-control"
                       size="20" data-rule="required"/>
                -
                <input type="text" data-toggle='datepicker' value="{$end_time}" name="end_time" class="form-control"
                       size="20" data-rule="required"/>
                <div class="btn btn-default search" data-icon="search"><i class="fa fa-search"></i> 查询</div>
            </div>
        </form>
    </div>
</block>
<!-- 身体 -->
<block name="bjui-pageContent">
</block>
<!-- 脚部 -->
<block name="bjui-pageFooter">
    <div class="bjui-pageFooter">
      <div class="pages"> <span>每页&nbsp;</span>
        <div class="selectPagesize">
          <select data-toggle="selectpicker" data-toggle-change="changepagesize">
            <option value="{$pageSize}">{$pageSize}</option>
            <option value="{$pageSize*3}">{$pageSize*3}</option>
            <option value="{$pageSize*6}">{$pageSize*6}</option>
            <option value="{$pageSize*12}">{$pageSize*12}</option>
            <option value="{$pageSize*15}">{$pageSize*15}</option>
          </select>
        </div>
        <span>&nbsp;条，共 {$total} 条</span> </div>
      <div class="pagination-box" data-toggle="pagination" data-total="{$total}" data-page-size="{$pageSize}"
             data-page-current="{$pageCurrent}"></div>
    </div>
</block>

<script>
    $(document).ready(function(){

        $.CurrentNavtab.find(".countDate").click(function(){
            var start_time = $(this).attr('value');
            var countDate = $(this).attr('name');
            console.log(countDate);
            $.CurrentNavtab.find("input[name=start_time]").val(start_time);
            $.CurrentNavtab.find("input[name=countDate]").val(countDate);
            $.CurrentNavtab.find('.bjui-pageHeader form').submit();
        })

        $.CurrentNavtab.find("input[name=countType]").on('ifChecked', function(event){
//            alert(event.type + ' callback');
            $.CurrentNavtab.find('.bjui-pageHeader form').submit();
        })

        $.CurrentNavtab.find(".search").click(function(){
            $.CurrentNavtab.find("input[name=countDate]").val('');
            $.CurrentNavtab.find('.bjui-pageHeader form').submit();
        })
    })
</script>